package JAVAcollectionsanddatastructures.Sort;

import java.util.Arrays;

public class sortTest {
    public static void main(String[] args) {
        int[] arr = {5,7,3,9,6,8};
        MySort mySort = new MySort();

        System.out.println("=======插入排序=======");
        mySort.insertSort(arr);
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("=======希尔排序========");
        mySort.shellSort(arr);
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("=======选择排序========");
        mySort.selectSort1(arr);
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("=======冒泡排序========");
        mySort.bubbleSort(arr);
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("=======快速排序========");
        mySort.quickSort(arr);
        System.out.println(Arrays.toString(arr));

        System.out.println();
        System.out.println("=======合并两个有序数组========");
        int[] array1 = {1,3,5,7,9};
        int[] array2 = {2,4,6,8,10};
        int[] elem = mySort.mergeArray(array1,array2);
        System.out.println(Arrays.toString(elem));

        System.out.println();
        System.out.println("=======归并排序=======");
        mySort.mergeSort1(arr);
        System.out.println(Arrays.toString(arr));
    }
}
